package com.wenson.behavior.visitor;

import java.time.LocalDate;

/**
 * @ClassName: Fruit
 * @Author: luowangcheng
 * @Date: 2024/6/16 15:35
 * @Description:
 */
public class Fruit extends Product implements Acceptable {
    private float weight;

    public Fruit(String name, LocalDate produceDate, float price, float weight) {
        super(name, produceDate, price);
        this.weight = weight;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);//把自己交给访问者
    }
}
